import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from "axios";
import VueAxios from 'vue-axios'
import ElementPlus from 'element-plus'
import 'element-plus/theme-chalk/index.css'
import "assets/css/base.css"
import * as ElIconModules from '@element-plus/icons-vue'
import {utils} from "./common/utils";
import {operate} from "./common/operate";
import {response} from "./common/response";
import {dictMap} from "./common/sys-params";
import {validate} from "./common/validation";
import {dateCalculator} from "./common/calculator";
import commonOperation from "./assets/js/personnelJs/CommonOperation";
import { Toast } from 'vant';

let app = createApp(App);

// 人事常用
app.config.globalProperties.$common = commonOperation;
//添加全局属性
app.config.globalProperties.$utils = utils;
app.config.globalProperties.$operate = operate;
app.config.globalProperties.$response = response;
app.config.globalProperties.$dictMap = dictMap;
app.config.globalProperties.$validate = validate;
app.config.globalProperties.$dateCalculator = dateCalculator;

// 全局 图标导入
Object.keys(ElIconModules).forEach(function(key) {
    app.component(ElIconModules[key].name, ElIconModules[key])
})
//
app.directive('focus', function (el) {
    el.querySelector('input').focus()
    console.log('聚焦');
})
app.use(router).use(store).use(VueAxios,axios).use(ElementPlus).use(Toast)
app.mount('#app');
